package Sta;
import java.util.Scanner;
public class xx {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);


        /*System.out.println("请选择商品：1.苹果 2.香蕉 3.梨 4.橘子 5.菠萝");
        int num = scan.nextInt();
        int money=0;
        switch (num){
            case 1:
                System.out.println("苹果");
                money+=50;
                break;

            case 2:
                System.out.println("香蕉");
                money+=60;
                break;
            case 3:
                System.out.println("梨");
                money+=70;
                break;
            case 4:
                System.out.println("橘子");
                money+=80;
                break;
            case 5:
                System.out.println("菠萝");
                money+=90;
                break;
            default:
                System.out.println(0);
        }*/
       String name1="苹果";

        double JG1=3.9;

        String BH1="1001";



        String name2="香蕉";

        double JG2=5.9;

        String BH2="1002";



        String name3="梨子";

        double JG3=9.9;

        String BH3="1003";



        System.out.println("欢迎来到超市收银系统！");

        System.out.println("请输入商品编号");

        String num=scan.next();

        System.out.println("请输入商品数量");

        int count=scan.nextInt();



        String name="";

        double JG=0;



        if (num.equals(BH1)) {

            name=name1;

            JG=JG1;

        }else if (num.equals(BH2)) {

            name=name2;

            JG=JG2;

        }else if (num.equals(BH3)) {

            name=name3;

            JG=JG3;

        }else {

            System.out.println("查无此商品");

        }



        double money=JG*count;

        System.out.println("您购买的是："+name+" 数量："+count+" 总价格："+money);



        System.out.println("请输入付款金额");

        double JE=scan.nextDouble();



        if (JE<money) {

            System.out.println("金额不足");

            return;

        }else {

            System.out.println("您购买了"+count+"个"+name+" 总价格："+money+ "你的付款金额："+JE+" 找零："+(JE-money)+"元");

            System.out.println("谢谢惠顾，欢迎下次光临");

        }
    }
}

























